<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Tpflow工作流引擎 V6.0</title>
    <link rel="stylesheet" href="/static/work/app.css">
    <link rel="stylesheet" type="text/css" href="/static/work/workflow.5.0.css?v5.0"/>
</head>
<body>
<div class="wrap">
    <div class="content">
        <form action="{$urls['designapi']}?act=saveatt" method="post" name="form" id="form" style="width: 100%;padding: 10px;">
            <div id="box" style='height: 98%;width: auto;'>
                    <input type="hidden" name="flow_id" value="{$one['flow_id']}"/>
                    <input type="hidden" name="process_id" value="{$one['id']}"/>
                    <input type="hidden" name="process_condition" id="process_condition" value='{$one.process_tos}'>
                    <table class="table">
                        <tr>
                            <th>节点ID</th>
                            <td width="240">{$one['id']}（{$one['process_type']}）</td>
                            <th>步骤名称</th>
                            <td><input type="text" class="smalls" name="process_name" value="{$one['process_name']}">
                            </td>
                        </tr>
                        <tr {if condition="($one.process_type == 'node-cc')or($one.process_type == 'node-msg')"}style="display: none"{/if}>
                            <th>权限管理</th>
                            <td>
                                <select name="is_sing" class="smalls">
                                    <option value="1">允许会签</option>
                                    <option value="2">禁止会签</option>
                                </select>
                                <select name="is_back" class="smalls">
                                    <option value="1">允许回退</option>
                                    <option value="2">不允许</option>
                                </select>
                            </td>
                            <th>调用方法</th>
                            <td>
                                <select class="smalls" name="wf_action_select" style="width: 40%;">
                                    <option value="1">自定义</option>
                                    {$wf_action_select|raw}
                                </select>
                                <input type="text" class="smalls" style="width: 50%;" name="wf_action" value="{$wf_action}"> <a target="_blank" href="//gadmin8.com/index/product.html">?</a>
                            </td>
                        </tr>

                        <tr id="node-process" {if condition="($one.process_type == 'node-cc')or($one.process_type == 'node-msg')"}style="display: none"{/if}>
                            <th>步骤模式</th>
                            <td colspan='3'>
                                <select name="wf_mode" id="wf_mode_id" datatype="*" nullmsg="请选择步骤模式" onchange="Tpflow.onchange(this,'wf_mode');" class="smalls">
                                    {$condition|raw}
                                </select>
                                <select name="is_time" class="smalls">
                                    <option value="0">不限办理时限</option>
                                    <option value="1">30分钟</option>
                                    <option value="2">60分钟</option>
                                    <option value="3">2小时</option>
                                    <option value="4">5小时</option>
                                    <option value="5">10小时</option>
                                    <option value="6">24小时</option>
                                    <option value="7">48小时</option>
                                    <option value="8">72小时</option>
                                </select>
                            </td>
                        </tr>
                        <tr id='wf_mode_2' {$wf_mode|raw} {if condition="($one.process_type == 'node-cc')or($one.process_type == 'node-msg')"}>
                            <td colspan=4>
                                <table class="table">
                                    <thead>
                                    <tr>
                                        <th style="width:30px;">步骤</th>
                                        <th>转出条件设置</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <!--模板-->
                                    {$process_to_html|raw}
                                </table>
                            </td>
                        </tr>

                        <tr id="node-user">
                            <th>办理人员</th>
                            <td colspan='3'>
                                <select class="smalls" name="auto_person" id="auto_person_id" datatype="*" nullmsg="请选择办理人员或者角色！" onchange="Tpflow.onchange(this,'auto_person');" style="float: left;">
                                    <option value="">请选择</option>
                                    {$process_type|raw}
                                    <option value="2">协同人员</option>
                                    <option value="4">指定人员</option>
                                    <option value="5">指定角色</option>
                                    <option value="6">事务接受</option>
                                </select>
                                <div style="margin-left: 100px;">
                                    <div class="hide auto_person" id="auto_person_2">
                                        <a class="button" onclick="Tpflow.lopen('办理人','{$urls['designapi']}?act=super_user&kid=auto_xt&type_mode=user','60','95')">指定人员</a>
                                        <input type="hidden" name="auto_xt_ids" id="auto_xt_ids" value="{$one['auto_xt_ids']}">
                                        <input type="hidden" name="auto_xt_text" id="auto_xt_text" value="{$one['auto_xt_text']}">
                                        <span id='auto_xt_html'>{$one['auto_xt_text']}</span>
                                    </div>
                                    <div class="hide auto_person" id="auto_person_3">
                                        <a class="button" onclick="Tpflow.lopen('办理人','{$urls['designapi']}?act=super_user&kid=range_user&type_mode=user','60','95')">自由选择</a>
                                        <input type="hidden" name="range_user_ids" id="range_user_ids" value="{$one['range_user_ids']}" datatype="*" nullmsg="请选择办理人员！">
                                        <input type="hidden" name="range_user_text" id="range_user_text" value="{$one['range_user_text']}">
                                        <span id='range_user_html'>{$one['range_user_text']}</span>
                                    </div>
                                    <div class="hide auto_person" id="auto_person_4">
                                        <a class="button" onclick="Tpflow.lopen('办理人','{$urls['designapi']}?act=super_user&kid=auto_sponsor&type_mode=user','60','95')">指定人员</a>
                                        <input type="hidden" name="auto_sponsor_ids" id="auto_sponsor_ids" value="{$one['auto_sponsor_ids']}">
                                        <input  type="hidden" name="auto_sponsor_text" id="auto_sponsor_text" value="{$one['auto_sponsor_text']}">
                                        <span id='auto_sponsor_html'>{$one['auto_sponsor_text']}</span>
                                    </div>
                                    <div class="hide auto_person" id="auto_person_5">
                                        <a class="button" onclick="Tpflow.lopen('指定角色','{$urls['designapi']}?act=super_user&kid=&type_mode=role','60','95')">指定角色</a>
                                        <input type="hidden" name="auto_role_ids" id="auto_role_ids" value="{$one['auto_role_ids']}">
                                        <span id='auto_role_html'>{$one['auto_role_text']}</span>
                                        <input  type="hidden" name="auto_role_text" id="auto_role_text" value="{$one['auto_role_text']}">
                                    </div>
                                    <div class="hide auto_person" id="auto_person_6">
                                        取业务表<select class="smalls" name='work_text'><option value="">选择字段</option>{$from_html|raw}</select>的
                                            <select class="smalls" name="work_ids">
                                                <option value="1">制单人员</option>
                                            </select>
                                    </div>

                                </div>
                                <hr/>
                                <div class="" style="float: left;">
                                    <!--事务接受，即为当条件满足时，系统自动流转到下一个步骤，无需审核-->
                                    当<<select class="smalls" name='work_auto'><option value="">字段值</option>{$from_html|raw}</select>>
                                    <select class="smalls" name="work_condition">
                                        <option value="=">等于</option>
                                        <option value=">">大于</option>
                                        <option value="<">小于</option>
                                        <option value=">=">大于等于</option>
                                        <option value="<=">小于小于</option>
                                        <option value="<>">不等于</option>
                                    </select>
                                    <input type="text" class="smalls" name="work_val" value="{$one['work_val']}">系统自动审批
                                </div>
                            </td>
                        </tr>
                    </table>
            <table class="table">
                <tr>
                    <td>
                        <button class="button" type="submit">保存</button>
                    </td>
                </tr>
            </table>
            </div>
        </form>



    </div>
</div>
<script src="/static/work/jquery-1.7.2.min.js"></script>
<script src="/static/work/lib/layer/2.4/layer.js"></script>
<script src="/static/work/tpflow.api.js"></script>
<script src="/static/work/workflow.5.0.js"></script>
<script type="text/javascript" src="/static/work/lib/Validform/5.3.2/Validform.min.js" ></script>
<script type="text/javascript">
    var apid = {$one['auto_person']};
    var process_type = "{$one['process_type']}";
    $("#auto_person_{$one['auto_person']}").show();
    $("#range_user_ids").removeAttr("datatype");
    $("#auto_sponsor_ids").removeAttr("datatype");
    $("#auto_role_ids").removeAttr("datatype");

    if (process_type !='node-end') {
        if (apid == 3) {
            $("#range_user_ids").attr({datatype: "*", nullmsg: "请选择办理人员1"});
        }
        if (apid == 4) {
            $("#auto_sponsor_ids").attr({datatype: "*", nullmsg: "请选择办理人员2"});
        }
        if (apid == 5) {
            $("#auto_role_ids").attr({datatype: "*", nullmsg: "请选择办理角色3"});
        }
    }else{
        $('#node-user').hide();
        $('#node-user').hide();
        $('#node-process').hide();
    }
    $("[name='auto_person']").find("[value='{$one['auto_person']}']").attr("selected", true);
    $("[name='is_sing']").find("[value='{$one['is_sing']}']").attr("selected", true);
    $("[name='is_back']").find("[value='{$one['is_back']}']").attr("selected", true);
    $("[name='work_text']").find("[value='{$one['work_text']}']").attr("selected", true);
    $("[name='work_ids']").find("[value='{$one['work_ids']}']").attr("selected", true);
    $("[name='wf_mode']").find("[value='{$one['wf_mode']}']").attr("selected", true);
    $("[name='work_auto']").find("[value='{$one['work_auto']}']").attr("selected", true);
    $("[name='wf_action_select']").find("[value='{$one['wf_action']}']").attr("selected", true);
    $("[name='work_condition']").find("[value='{$one['work_condition']}']").attr("selected", true);
    $("[name='is_time']").find("[value='{$one['is_time']}']").attr("selected", true);

        $(function(){
        $("#form").Validform({
            tiptype:function(msg,o,cssctl){
                if (o.type == 3){
                    layer.msg(msg, {time: 800});
                }
            },
            ajaxPost:true,
            showAllError:true,
            callback:function(ret){
                Tpflow.common_return(ret);
            }
        });
    });
</script>
</body>
</html>